import re
'''
m=re.match("the","the dog is wolf")
if  m  is not None:
    print(m.group())

'''
#搜索 ^the以the为开头
'''
m=re.search("^the"," there,the dog is wolf")
if  m  is not None:
    print(m.group())
else:
    print("not find")
m=re.search("^the","the dog is wolf")
if  m  is not None:
    print(m.group())
else:
    print("not find")

#搜索 \Athe以the为开头   \A与^the
m=re.search("the"," there,the dog is wolf")
if  m  is not None:
    print(m.group())
else:
    print("not find")
'''

#the$  the\Z 判断是否以the为结尾
'''
m=re.search("the\Z"," there,the")
if  m  is not None:
    print(m.group())
else:
    print("not find")

'''
#  the  \w  \W  结束符
#"the\b"    mythe 结束符
#"the\b"    mytheit ,不能
# \b 挖出结束的词语  \B相反 挖出中间的词语
m=re.search(r"the\B","mythe")
if  m  is not None:
    print(m.group())
else:
    print("not find")






